import {defineStore} from "pinia";
import {reactive, ref} from "vue";

export const useInfoStore = defineStore('users', () => {
  // let userInfo = ref({name: '张三', age: 18});
  // let userInfo = ref({});
  let userInfo = reactive({obj: {}})

  function changeUserInfo(val: any) {
    // console.log(val)
    // userInfo.value = val;
    userInfo.obj = val;
  }

  return {userInfo, changeUserInfo}
},{persist: true})
/*export const useInfoStore = defineStore('users', {
  state: () => ({obj: {}}),
  actions: {
    changeUserInfo(val: any) {
      this.obj = val;
    },
  },
})*/
